home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-04-06 | 3.0 KB | 102 lines | [TEXT/ttxt] |
- -- This script is meant to replace the stack script for the Phone stack
- -- that comes with version 1.0.1 of HyperCard. It uses an adaptation of a
- -- trick by Daniel J. Rosenbaum that is published in the May 1988 issue
- -- of MacUser. It will send a message to your modem to disconnect two
- -- seconds after it dials a number, giving control of the phone line
- -- back to your phone. All you have to do is pick up the phone within
- -- two seconds, and you’ll be able to hold your conversation. Just open
- -- the stack script for the phone stack (make sure its the old one that
- -- doesn’t list local exchanges), select the entire script, and paste this one
- -- in. Dave Fell, 70040,674
-
- -- Copyright 1987 Apple Computer Inc.
-
-
- on idle
- if the short time ≠ field "loc time" then
- put the short time into field "loc time"
- end if
- pass idle
- end idle
-
- on openStack
- show message box
- end openStack
-
- on dial string
- global dialNumber, dialArea
- put string into dialNumber
- if string is empty then exit dial
-
- findAreaCode
- -- sets dialNumber and dialArea
- -- we do not handle international phone numbers correctly
-
- if dialNumber is empty then exit dial
-
- if dialArea contains field "area code"
- then put field "preamble" before dialNumber
- else put field "long dist preamble" & dialArea & " " before dialNumber
-
- put "Now dialing: " & dialNumber
-
- if hilite of button "modem (tone dialing)" is true
- then send "dial " & quote & dialNumber & quote & " with modem " & ¬
- quote & "ATS0=0DT" & quote to HyperCard
-
- if hilite of button "modem (pulse dialing)" is true
- then send "dial " & quote & dialNumber & quote & " with modem " & ¬
- quote & "ATS0=0DP" & quote to HyperCard
-
- if hilite of button "speaker (tone dialing)" is true
- then send "dial " & quote & dialNumber & quote to HyperCard
-
- wait 2 seconds
- send "dial" & quote & empty & quote & "with modem" & quote & ¬
- "+++ATH" & quote to HyperCard
- put empty
- end dial
-
- on findAreaCode
- global dialArea,dialNumber
- stripNonDigits
- if first char of dialNumber is "1" then
- put empty into char 1 of dialNumber -- remove "1"
- stripNonDigits
- end if
-
- if first char of dialNumber is "9" and "-, " contains char 2 of dialNumber then
- put empty into char 1 of dialNumber -- remove "9"
- stripNonDigits
- end if
-
- get char 2 of dialNumber
- if it is 0 or it is 1 then
- put " " after char 3 of dialNumber
- put first word of dialNumber into dialArea
- put empty into first word of dialNumber
- stripNonDigits
- else put field "area code" into dialArea
-
- stripTrailer
- end findAreaCode
-
- on stripNonDigits
- global dialNumber
- repeat for the length of dialNumber
- get first char of dialNumber
- if it is in "0123456789" then exit stripNonDigits
- put empty into first char of dialNumber
- end repeat
- end stripNonDigits
-
- on stripTrailer
- global dialNumber
- repeat for the length of dialNumber
- get last char of dialNumber
- if it is in "0123456789#*ABCD" then exit stripTrailer
- put empty into last char of dialNumber
- end repeat
- end stripTrailer
-
-